﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="treemore2.aspx.cs" Inherits="UserControls_treemore2" %>

<%@ Register src="~/UserControls/CFooterControl.ascx" tagname="CFooterControl" tagprefix="uc1" %>
<%@ Register src="~/UserControls/CHeaderControl.ascx" tagname="CHeaderControl" tagprefix="uc2" %>
<%@ Register src="blockothers.ascx" tagname="blockothers" tagprefix="uc4" %>
<%@ Register src="blockinvite.ascx" tagname="blockinvite" tagprefix="uc5" %>
<%@ Register src="blockflv.ascx" tagname="blockflv" tagprefix="uc6" %>
<%@ Register src="blockask.ascx" tagname="blockask" tagprefix="uc7" %>
<%@ Register src="blockvote.ascx" tagname="blockvote" tagprefix="uc8" %>
<%@ Register src="blockbusiness.ascx" tagname="blockbusiness" tagprefix="uc9" %>
<%@ Register src="blocksubscribe.ascx" tagname="blocksubscribe" tagprefix="uc10" %>
<%@ Register src="blockbulletin.ascx" tagname="blockbulletin" tagprefix="uc11" %>
<%@ Register src="blockshare.ascx" tagname="blockshare" tagprefix="uc3" %>
<%@ Register src="uc_Location.ascx" tagname="uc_Location" tagprefix="uc12" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>

</head>  
<body>
<form id="form1" runat="server">
<div id="pagemasker"></div><div id="dialog"></div>
<div id="doc">



<uc2:CHeaderControl ID="CHeaderControl1" runat="server" />



<div id="bdw" class="bdw">
<div id="bd" class="cf">

<div class="midad">
 <uc12:uc_Location ID="uc_Location1" runat="server"  Location="1"/>
 </div>


	<div id="deal-default">

   

      
		<div id="content">
          <!--循环开始-->
         <%int num = 0; %>
            <%foreach (Maticsoft.Model.Team model in otherteams)
              {
              
                 
                  %>

       <!-- 循环分享信息 -->
       <div id="deal-share">

  
    <div class="deal-share-top">
		<div class="deal-share-links">
			<h4>分享到：</h4>
			<ul class="cf"><li><a class="im" href="javascript:void(0);" id="deal-share-im" onclick="$('#deal-share-im-c-<%=model.Id %>').toggle();">MSN/QQ</a></li><li><a class="kaixin" href="<%=wshelp.Share_kaixin( model,WWWprefix,ASUserArr["id"], ASSystemArr) %>" target="_blank">开心</a></li><li><a class="renren" href="<%=wshelp.Share_renren( model,WWWprefix,ASUserArr["id"], ASSystemArr) %>" target="_blank">人人</a></li><li><a class="douban" href="<%=wshelp.Share_douban( model,WWWprefix,ASUserArr["id"], ASSystemArr) %>" target="_blank">豆瓣</a></li><li><a class="sina" href="<%=wshelp.Share_sina( model,WWWprefix,ASUserArr["id"], ASSystemArr) %>" target="_blank">新浪微博</a></li><li><a class="email" href="<%=wshelp.Share_mail( model,WWWprefix,ASUserArr["id"], ASSystemArr) %>" id="A3">邮件</a></li></ul>

		</div>
	</div>
  

	<div class="deal-share-fix"></div>
	<div id="deal-share-im-c-<%=model.Id %>" style="display: none;" class="deal-share-im-c ">
		<div class="deal-share-im-b">
			<h3>复制下面的内容后通过 MSN 或 QQ 发送给好友：</h3>
			<p><input id="share-copy-text-<%=model.Id %>" type="text"  value="<%=WWWprefix %>team.aspx?id=<%=model.Id %>&r=<%=ASUserArr["id"] %>" size="40" class="f-input" tip="复制成功，请粘贴到你的MSN或QQ上推荐给您的好友"/> <input id="share-copy-button" type="button" value="复制" class="formbutton" onclick="X.misc.copyToCB('share-copy-text-<%=model.Id %>');"  /></p>

		</div>
	</div>
</div>
      
			<div id="deal-intro" class="cf">
                <h1><%if (!isover(model))
                      { %><a class="deal-today-link" href="../team.aspx?id=<%=model.Id %>"><%=type(model)%>:</a><a class="deal-today-link-xx" href="../team.aspx?id=<%=model.Id %>"><%=model.Title%></a><%} %></h1>
                <div class="main">
                    <div class="deal-buy">
                        <div class="deal-price-tag"></div>
					<%if (GetState(model) == TeamState.successnobuy)
       { %>
                        <p class="deal-price"><strong><%=ASSystemArr["currency"]%><%=GetMoney(model.Team_price)%></strong><span class="deal-price-over"></span></p>
					<%}
       else if (isover(model))
       { %>

                        <p class="deal-price"><strong><%=ASSystemArr["Currency"]%><%=GetMoney(model.Team_price)%></strong><span class="deal-price-end"></span></p>
<%}
       else
       {
           
           
           %> 
                        <p class="deal-price"><strong><%=ASSystemArr["Currency"]%><%=GetMoney(model.Team_price)%></strong>
                        
                      <%--  <span>--%>
                   
               

               <%
                   if (AsUser != null)
                   {
                       int num1 = model.Id;
                       System.Collections.Generic.List<Maticsoft.Model.Order> orders = Maticsoft.BLL.Order.GetUnpayModel(ASUser.Id, model.Id);
                       if (orders.Count > 0)
                       {
                           order = Utils.Helper.GetObjectProtery(orders[0]);
                           if (order.Count > 0)
                           {
                           %>
                 <%--   <a href="../order/check.aspx?orderid=<%=order["id"] %>" target=_blank> <img src="<%=ImagePath() %>button-deal-buy.gif" /></a>--%>
                    <a href="../order/check.aspx?orderid=<%=order["id"] %>" target=_blank><span class="deal-price-buy"></span></a>
                    <% }
                           else
                           {%>
                            <a href="../ajax/car.aspx?id=<%=model.Id %>" target=_blank><span class="deal-price-buy"></span></a>
                    <% }%>
                     <% }else{%>
                        <a href="../ajax/car.aspx?id=<%=model.Id %>" target=_blank><span class="deal-price-buy"></span></a>
                      <% }%>
          
             
                <% }else{ %>
                <a href="../ajax/car.aspx?id=<%=model.Id %>" target=_blank><span class="deal-price-buy"></span></a>
                <% }%>

             <%--   </span></p>--%>

           <%--         <a href="../ajax/car.aspx?id=<%=model.Id %>" target=_blank> <img src="<%=ImagePath() %>button-deal-buy.gif" /></a></span></p>--%>
             
         
                  
          
             
                <% } %>
                    </div>
                    <table class="deal-discount">
                        <tr>
                            <th>原价</th>
                            <th>折扣</th>
                            <th>节省</th>
                        </tr>
                        <tr>

                            <td><%=ASSystemArr["Currency"]%><%=GetMoney(model.Market_price)%></td>

							<td><%=Utils.WebSiteHelper.GetDiscount(Utils.Helper.GetDecimal(model.Market_price, 0), Utils.Helper.GetDecimal(model.Team_price, 0))%></td>
                            <td><%=ASSystemArr["Currency"]%><%=GetMoney((Utils.Helper.GetDecimal(model.Market_price, 0) - Utils.Helper.GetDecimal(model.Team_price, 0)).ToString())%></td>
                        </tr>
                    </table>
					<%if (isover(model))
       { %>
                    <div class="deal-box deal-timeleft deal-off" id="deal-timeleft" curtime="<%=curtimefix %>" diff="<%=difftimefix %>">
						<h3>本团购结束于</h3>
						<div class="limitdate"><p class="deal-buy-ended"><%=overtime.ToString("yyyy-MM-dd HH:mm:ss")%><br/></p></div>
					</div>
					<%}
       else
       {
           curtimefix = Utils.Helper.GetTimeFix(DateTime.Now) * 1000;
           difftimefix = Utils.Helper.GetTimeFix(model.End_time) * 1000;
           difftimefix = difftimefix - curtimefix;
           
           %>
                    <div class="deal-box deal-timeleft deal-on" num="<%=num %>" id="deal-timeleft" curtime="<%=curtimefix %>" diff="<%=difftimefix %>">
						<h3>剩余时间</h3>
						<div class="limitdate"><ul id="counter<%=num %>">
						<%if ((model.End_time - DateTime.Now).Days > 0)
        { %>
							<li><span><%=(model.End_time - DateTime.Now).Days%></span>天</li><li><span><%=(model.End_time - DateTime.Now).Hours%></span>小时</li><li><span><%=(model.End_time - DateTime.Now).Minutes%></span>分钟</li>
						<%}
        else
        { %>
							<li><span><%=(model.End_time - DateTime.Now).Hours%></span>小时</li><li><span><%=(model.End_time - DateTime.Now).Minutes%></span>分钟</li><li><span><%=(model.End_time - DateTime.Now).Seconds%></span>秒</li>
						<%} %>
						</ul></div>
					</div>
					<%} %>

				<%if (!isover(model))
      { %>

					<%if (state == TeamState.begin)
       {
           if (model.Min_number > 0)
            {
                size = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(190 * (Convert.ToDouble(model.Now_number) / Convert.ToDouble(model.Min_number)))));

                offset = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(5 * (Convert.ToDouble(model.Now_number) / Convert.ToDouble(model.Min_number)))));
            }%>

					<div class="deal-box deal-status" id="deal-status">
						<p class="deal-buy-tip-top"><strong><%=model.Now_number%></strong> 人已购买</p>
						<div class="progress-pointer" style="padding-left:<%=(size-offset)%>px;"><span></span></div>
						<div class="progress-bar"><div class="progress-left" style="width:<%=(size-offset)%>px;"></div><div class="progress-right "></div></div>
						<div class="cf"><div class="min">0</div><div class="max"><%=model.Min_number%></div></div>
                        <%if (model.Max_number > 0)
                          { %>
						<p class="deal-buy-tip-btm">还差 <strong><%= (model.Min_number - model.Now_number)%></strong> 人到达最低团购人数</p>
                        <%} %>
					</div>
				<%}
       else if (state == TeamState.successbuy)
       { %>
					<div class="deal-box deal-status deal-status-open" id="deal-status">
						<p class="deal-buy-tip-top"><strong><%=model.Now_number%></strong> 人已购买</p>
					<%if (model.Max_number > 0 && model.Max_number > model.Now_number)
       { %>
               
						<p class="deal-buy-tip-btm">本单仅剩：<strong><%=model.Max_number - model.Now_number%></strong>份，欲购从速</p>
					<%} %>

                    <%if (model.Now_number >= model.Min_number)
                      { %>
						<p class="deal-buy-on" style="line-height:200%;"><img src="<%=ImagePath() %>deal-buy-succ.gif"/> 团购成功！
                        <% }%>
                        
                        
                         <%if ((model.Max_number == 0) || (model.Max_number - model.Now_number) > 0)
                           { %><br/>还可以继续购买<%} %></p>
					<%if (model.Reach_time.HasValue)
       { %>
						<p class="deal-buy-tip-btm"><%=model.Reach_time.Value.ToString("MM-dd HH:mm")%>达到最低团购人数：<strong><%=model.Min_number%></strong>人</p>
					<%} %>
					</div>
					<%} %>
				<%}
      else
      { %>

					<div class="deal-box deal-status deal-status-<%=teamstatestring %>" id="deal-status"><div class="deal-buy-<%=teamstatestring %>"></div><p class="deal-buy-tip-total">共有 <strong><%=model.Now_number%></strong> 人购买</p></div> 
				<%} %>
				</div>
                <div class="side">
                    <div class="deal-buy-cover-img" id="team_images" imglist="team_images">
				<%if (model.Image1 != String.Empty || model.Image2 != String.Empty)
       { %>
						<div class="mid">
							<ul>
								<li class="first"><a href="/team.aspx?id=<%=model.Id %>" target=_blank><img src="<%=model.Image %>"/></a></li>
							<%if (model.Image1 != String.Empty)
         { %>
								<li><a href="/team.aspx?id=<%=model.Id %>" target=_blank><img src="<%=model.Image1 %>"/></a></li>
							<%} %>
							<%if (model.Image2 != String.Empty)
         { %>
								<li><a href="/team.aspx?id=<%=model.Id %>" target=_blank><img src="<%=model.Image2 %>"/></a></li>
							<%} %>
							</ul>
							<div id="img_list" img="img_list">
								<a ref="1" class="active">1</a>
						<%imageindex = 1;%>
							<%if (model.Image1 != String.Empty)
         { %><%imageindex = imageindex + 1;%>
								<a ref="<%=imageindex %>" ><%=imageindex%></a>

							<%
         } %>
							<%if (model.Image2 != String.Empty)
         {
             imageindex = imageindex + 1;%>
								<a ref="<%=imageindex %>" ><%=imageindex%></a>
							<%} %>
							</div> 
						</div>
  
						<%}
       else
       { 
						    %>
							<a href="../team.aspx?id=<%=model.Id %>" target=_blank><img src="<%=model.Image %>" width="440" height="280" /></a>
						<%} %>
					</div>
                    <div class="digest"><br /><%=model.Summary%></div>
                </div>
            </div>
            <br />
            

            <% 
                num++;
                
              }%>
              <!--循环结束-->
</div>
               

          <%--  <div id="deal-stuff" class="cf">--%>
          
       <div id="sidebar">


<%=Maticsoft.BLL.Location.Getimg() %>


<uc5:blockinvite ID="blockinvite1" runat="server" />
     

<uc11:blockbulletin ID="blockbulletin1" runat="server" />


<uc6:blockflv ID="blockflv1" runat="server" />

<uc7:blockask ID="blockask1" runat="server" />



<uc8:blockvote ID="blockvote1" runat="server" />


<uc9:blockbusiness ID="blockbusiness1" runat="server" />
    

<uc10:blocksubscribe ID="blocksubscribe1" runat="server" />
 
</div>   
   
</div>
 
</div> <!-- bd end -->

</div> <!-- bdw end -->

<uc1:CFooterControl ID="CFooterControl1" runat="server" />

</div>
</form>

</body>
</html>